package dfbz.homework1;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Test06 {
    public static void main(String[] args) {
        HashMap<String, Student> map = new HashMap<>();
        Student s1 = new Student("张三1", 12);
        Student s2 = new Student("张三2", 12);
        Student s3 = new Student("张三3", 12);
        Student s4 = new Student("张三4", 12);
        Student s5 = new Student("张三5", 12);
        String zh1="天河区1";
        String zh2="天河区2";
        String zh3="天河区3";
        String zh4="天河4区";
        String zh5="天河5区";
        map.put(zh1,s1);
        map.put(zh2,s2);
        map.put(zh3,s3);
        map.put(zh4,s4);
        map.put(zh5,s5);
        Set<String> strings = map.keySet();
        for (String string : strings) {
            System.out.println(string);
        }
        Set<Map.Entry<String, Student>> entries = map.entrySet();
        for (Map.Entry<String, Student> entry : entries) {
            System.out.println(entry);
        }
    }
}
